<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link href="{ADMIN_THEME}images/reset.css" rel="stylesheet" type="text/css" />
    <link href="{ADMIN_THEME}images/system.css" rel="stylesheet" type="text/css" />
    <link href="{ADMIN_THEME}images/dialog.css" rel="stylesheet" type="text/css" />
    <link href="{ADMIN_THEME}images/main.css" rel="stylesheet" type="text/css" />
    <link href="{ADMIN_THEME}images/switchbox.css" rel="stylesheet" type="text/css" />
    <link href="{ADMIN_THEME}luos/css/style.min.css?v=4.1.0" rel="stylesheet"><link href="{ADMIN_THEME}images/table_form.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="{ADMIN_THEME}js/layui/css/layui.css">
    <script src="{ADMIN_THEME}js/layui/lay/dest/layui.all.js"></script>
    <script type="text/javascript" src="{ADMIN_THEME}js/jquery.min.js"></script>
    <title>admin</title>

</head>
<body style="font-weight: normal;">
<div class="subnav">
    <div class="content-menu ib-a line-x">
        <div class="layui-btn-group">
            <a class="layui-btn" href="{url('admin/zhou_position/area_list')}"><em>全部列表</em></a>
            <a class="layui-btn" href="{url('admin/zhou_position/dao_area')}"><em>导入区域数据</em></a>
            <!--<a class="layui-btn" href="{url('admin/zhou_position/city_management_add',array('parentid'=>$parentid,'diqu'=>$diqu))}"><em>新增{$diqu}</em></a>-->
            <a class="layui-btn" onClick="window.history.go(-1);" href="javascript:void(0);"><em>上一页</em></a>
            }

        </div>
    </div>
    <!-- {php var_dump($parentid);} -->
    <div class="bk10"></div>
    <div class="table-list">
        <form action="" method="post">
            <table width="100%">
                <tr>
                    <!-- <td width="" align="center"><input type="checkbox" name="checkall" value="" /></td> -->
                   
                    <td width="" align="center">{$diqu}</td>
                    <td width="" align="center">是否显示</td>
                    <td width="" align="center">操作</td>
                    <td>
                    </td>
                </tr>
                {loop $res $key=>$t}
                <!-- {php echo '<pre>'; var_dump($t);} -->
                <tr>
                    <!-- <td align="center"><input name="del_id[]" type="checkbox" value="{$t['id']}" class="child_box" /></td> -->
                    <!--{if $diqu=='市区'}
                    <td align="center"><input name="host[]" type="checkbox" {if $t[lei_golf_host]==1 }checked="checked"{/if}  value="{$t['id']}"  /></td>
                    {/if}-->
                    <td align="center">{$t['area_name']}</td>
                    <td align="center">{if $t['area_show'] == 1}<span class="label label-success">√</span>{else}<span class="label label-important">×</span> {/if}</td>
                    <td align="center">
                        {if $diqu!=='县/区'}
                        <a class="layui-btn layui-btn-small layui-btn-normal " href="{url('admin/zhou_position/area_list',array('cat_id'=>$t['area_id'],'diqu'=>$diqu))}">查看</a>
                        {/if}
                        {if $diqu!=='省份'}
                        <!-- <a class="layui-btn layui-btn-small " href="{url('admin/golf_city/city_management_add',array('edit_id'=>$t['id'],'diqu'=>$diqu))}">增加</a> -->
                        {/if}
                        <a class="layui-btn layui-btn-small layui-btn-danger" onclick="return del()" href="{url('admin/zhou_position/area_del',array('del_id'=>$t['area_id']))}">删除</a>
                    </td>
                </tr>
                {/loop}
                <tr>
                    <td align="center"><!-- <input type="submit" class="btn btn-success btn-sm del" onclick=" return pi_del()"  value="批量删除"> --></td>
                    <td align="center">&nbsp;</td>
                    <td align="center">&nbsp;</td>
                    {if $diqu=='市区'}
                    <!--<td align="center"><input type="submit" class="btn btn-success btn-sm " id="host"  onclick="return ord()" value="设置为热门城市"></td>-->
                    {/if}
                    <td align="center">&nbsp;</td>


                </tr>
            </table>
            {$pagelist}
        </form>
    </div>
</div>
<!-- <script>
$("#host").click(function(){
    var host = [] ;
    var host_id = [];
    $("input[name='host[]']").each(function(){
             ord.push($(this).val());
    })
    $("input[name='host_id[]']").each(function(){
         del_id.push($(this).val());
    })
    $.ajax({
            'url':'index.php?s=admin&c=Golf_city&a=city_management_host',
            'type':'post',
            'dataType':'json',
            'async':false,
            'data':{
                'host':host,
                'host_id':host_id,
            },
            success:function(data){
                if (data.str == 1) {
                    window.location.reload();
                }
            }
        })
    return false;
})
</script> -->
<script>
    // 全选/全不选
    $("input[name='checkall']").change(function(){
        if($(this).is(':checked')){
            $('.child_box').attr('checked',true)
        }else{
            $('.child_box').attr('checked',false)
        }
    })
    // 确定删除
    function del(){

        var gnl=confirm("是否确定删除?");

        if (gnl==true){
            return true;
        }else{
            return false;
        }
    }

    function pi_del(){
        var gnl=confirm("是否确定批量删除?");
        if (gnl==true){
            if ($('.deletec').is(':checked')) {
                return true;
            }else{
                alert('至少选择一个数据！')
                return false;
            }
        }else{
            return false;
        }
    }

    /*    function ord(){
     var gnl=confirm("是否确定提交城市?");
     if (gnl==true){
     if ($('#host').is(':checked')) {
     return true;
     }else{
     alert('至少选择一个数据！')
     return false;
     }
     return false;
     }else{
     return false;
     }
     }*/
</script>
</body>
</html>